package jdbc;

import java.io.IOException;
import java.util.Properties;

/**
 * @classname:PropUtil
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/28 9:15
 * @version: 0.1
 * @since:1.8
 */
public class PropUtil {
    private PropUtil(){}

    private static Properties properties;
    static {
        properties=new Properties();
        try {
            properties.load(PropUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"));
            Class.forName(PropUtil.getValue("driver"));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
    public static String  getValue(String key){
        return properties.getProperty(key);
    }

}
